package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Reading entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "reading", catalog = "makeiteasy")
public class Reading implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer readId;
	private Passage passageByPassageIid;
	private Passage passageByPassageIiid;
	private String readDirection;
	private String readI;
	private String readIi;
	private String readIkeys;
	private String readIikeys;
	private Set<Test> tests = new HashSet<Test>(0);

	// Constructors

	/** default constructor */
	public Reading() {
	}

	/** full constructor */
	public Reading(Passage passageByPassageIid, Passage passageByPassageIiid,
			String readDirection, String readI, String readIi,
			String readIkeys, String readIikeys, Set<Test> tests) {
		this.passageByPassageIid = passageByPassageIid;
		this.passageByPassageIiid = passageByPassageIiid;
		this.readDirection = readDirection;
		this.readI = readI;
		this.readIi = readIi;
		this.readIkeys = readIkeys;
		this.readIikeys = readIikeys;
		this.tests = tests;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "readId", unique = true, nullable = false)
	public Integer getReadId() {
		return this.readId;
	}

	public void setReadId(Integer readId) {
		this.readId = readId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "passageIId")
	public Passage getPassageByPassageIid() {
		return this.passageByPassageIid;
	}

	public void setPassageByPassageIid(Passage passageByPassageIid) {
		this.passageByPassageIid = passageByPassageIid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "passageIIId")
	public Passage getPassageByPassageIiid() {
		return this.passageByPassageIiid;
	}

	public void setPassageByPassageIiid(Passage passageByPassageIiid) {
		this.passageByPassageIiid = passageByPassageIiid;
	}

	@Column(name = "readDirection", length = 512)
	public String getReadDirection() {
		return this.readDirection;
	}

	public void setReadDirection(String readDirection) {
		this.readDirection = readDirection;
	}

	@Column(name = "readI", length = 2024)
	public String getReadI() {
		return this.readI;
	}

	public void setReadI(String readI) {
		this.readI = readI;
	}

	@Column(name = "readII", length = 2024)
	public String getReadIi() {
		return this.readIi;
	}

	public void setReadIi(String readIi) {
		this.readIi = readIi;
	}

	@Column(name = "readIKeys", length = 128)
	public String getReadIkeys() {
		return this.readIkeys;
	}

	public void setReadIkeys(String readIkeys) {
		this.readIkeys = readIkeys;
	}

	@Column(name = "readIIKeys", length = 128)
	public String getReadIikeys() {
		return this.readIikeys;
	}

	public void setReadIikeys(String readIikeys) {
		this.readIikeys = readIikeys;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "reading")
	public Set<Test> getTests() {
		return this.tests;
	}

	public void setTests(Set<Test> tests) {
		this.tests = tests;
	}

}